package com.xiaolin.springsecurity.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author xiaolin
 * @Description LoginController
 * @email xiaolin@gmail.com
 * @date 2024/5/4 11:36
 */
@Controller
@RequestMapping("/auth")
public class LoginController {

    /**
     * 跳转到登录页
     *
     * @return
     */
    @GetMapping("/login")
    public String toLogin() {
        return "login";
    }

    /**
     * 登录成功跳转到首页
     *
     * @return
     */
    @GetMapping("/index")
    public String toIndex() {
        return "index";
    }

    /**
     * 用户无权限页面
     *
     * @return
     */
    @GetMapping("/accessError")
    public String toAccessError() {
        return "403";
    }
}
